package com.kylin.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {

    //对应数据库中的主键(uuid,自增id,雪花算法,redis,zookeeper)
    @TableId(type = IdType.INPUT)
    private Long id;
    private String name;
    private Integer age;
    private String email;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;//插入时按照插入策略填充字段
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;//插入时按照插入策略填充字段，更新时按照更新策略填充字段

    @Version//乐观锁
    private int version;

    @TableLogic//逻辑删除
    private int deleted;
}
